<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="java.io.*,java.util.*,java.sql.*"%>
<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
 <%request.setCharacterEncoding("UTF-8");%> 	
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%request.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=UTF-8"); %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
    <sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver"
     url="jdbc:mysql://localhost:3306/gms?useUnicode=true&characterEncoding=utf-8"
     user="root"  password="123456"/>
     
<sql:query dataSource="${snapshot }" var="result">
SELECT * from enterpriseinformation;
</sql:query>

      <table border="1" width="50%">
         <thead>
           <tr>
              <th>公司名称</th>
              <th>公司地址</th>
              <th>薪酬</th>
              <th>联系电话</th>
              <th>工作职位</th>
              <th>联系人</th>
              <th>邮箱</th>
              <th>操作</th>
           </tr>
         </thead>
         <tbody>
             <c:forEach items="${result.rows }" var="a">
             <tr>
                <td>${a.Enterprise_Name }</td>
                <td>${a.Enterprise_Location }</td>
                <td>${a.Salary }</td>
                <td>${a.Enterprise_Telephone }</td>
                <td>${a.Profession }</td>
                <td>${a.Contacts }</td>
                <td>${a.Enterprise_Email }</td>
                <td>
                    <a href="GMS/EnterpriseInfoDelete?enterpriseid=${ a.EnterpriseID}">删除</a>
                    <a href="GMS/EnterpriseInfoEdit?enterpriseid=${a.EnterpriseID }">编辑</a>
                 </td>
              </tr>
            </c:forEach>
         </tbody>
        </table>
</body>
</html>